<template>
  <div class="home">
    <no-device v-if="!devices.length" @device="setDevices" />
    <ActionBox v-else></ActionBox>
  </div>
</template>

<script>
// @ is an alias to /src
import aardio from "aardio";
import NoDevice from "@/components/NoDevice";
import ActionBox from "@/components/ActionBox";

export default {
  name: "HomeView",
  components: { NoDevice, ActionBox },
  provide() {
    return {
      device: this.devices,
    };
  },
  data() {
    return {
      devices: ["1", "2"],
    };
  },
  methods: {
    testAlert() {
      aardio.alert("test");
    },
    setDevices(devices) {
      this.devices = devices;
    },
  },
};
</script>
